package com.huanmeiqi.demo.persistence.two;

/**
 * @author cq.Wang
 * @date 2018/6/14 9:16
 * @description 保存一个线程安全的DatabaseType容器
 */
public class DBContextHolder {
    private static final ThreadLocal<DatabaseType> contextHolder = new ThreadLocal<DatabaseType>();

    public static void setDatabaseType(DatabaseType type) {
        contextHolder.set(type);
    }

    public static DatabaseType getDatabaseType() {
        return contextHolder.get();
    }
}
